package com.rising.collections;

import java.util.HashSet;
import java.util.Set;

/**
 * @Author: rising
 * @Description:
 * @Date: create in 2021/2/26 9:58
 */
public class HashSetTest {

    public static void main(String[] args) {
        Set<String> set = new HashSet<>();
        set.add("sdf");
        set.add("1sdf");
        set.add("asdf");
        set.add("asdfg");
        set.add("B");
        set.add("E");
        set.add("D");
        set.add("C");
        set.add("A");
        set.add("1");
        System.out.println(set);

        System.out.println("--------------------哈希值--------------------");
        System.out.println("A的hash：" + "A".hashCode());
        System.out.println("B的hash：" + "B".hashCode());
        System.out.println("C的hash：" + "C".hashCode());
        System.out.println("D的hash：" + "D".hashCode());
        System.out.println("E的hash：" + "E".hashCode());
        System.out.println("sdf的hash：" + "sdf".hashCode());
    }

}
